import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import AntDesignVue from "ant-design-vue";
// 全局插件
import i18n from "./views/vue/logical-reuse/03_plugins/i18n";
import i18nData from "./views/vue/logical-reuse/03_plugins/i18nData";
// 全局组件
import GlobalComponentVue from "./views/vue/deep-component/01_RegisterVue/GlobalComponentVue";
import "ant-design-vue/dist/antd.css";

// 根组件
let app = createApp(App)
  //  pinia
  .use(createPinia())
  // 全局插件
  .use(i18n, i18nData)
  // 注册全局指令
  .directive("updateColor", {
    mounted: (el) => {
      el.style.color = "red";
    },
  })
  // 注册全局属性
  .provide("GlobalObject", { name: "我是全局属性" })
  // 注册全局组件
  .component("GlobalComponentVue", GlobalComponentVue)
  // 状态维护
  .use(store)
  // 路由
  .use(router)
  // UI组件库
  .use(AntDesignVue);
// 挂载
app.mount("#app");
